--TEST--
Check for error watching
--FILE--
<?php
// prepare
pdl_enable(true);
pdl_watch(PDL_W_ERROR | PDL_W_LOAD);

$output_dir = realpath(ini_get('pdlogger.output_dir'));
$period = (int) ini_get('pdlogger.period');
$time = time();
$time = ($time - ($time % $period));
$text_log_file = $output_dir . "/text/$time.log";

pdl_start(true);

@strpos();	// watch error

include "sample.php";	// watch load file

pdl_stop();

@strpos();	// won't log this error

// result

list($err, $load) = pdl_export();

echo "Watch php error:\n";
echo '$err[level] = ' . $err['level'] . "\n";
echo '$err[label] = ' . $err['label'] . "\n";
echo '$err[msg] = ' . $err['msg'] . "\n";
echo '$err[data] = ' . $err['data'] . "\n";
echo '$err[file] = ' . $err['file'] . "\n";

echo "\nWatch load php file:\n";
echo '$load[level] = ' . $load['level'] . "\n";
echo '$load[label] = ' . $load['label'] . "\n";
echo '$load[msg] = ' . $load['msg'] . "\n";
echo '$load[data] = ' . $load['data'] . "\n";
echo '$load[file] = ' . $load['file'] . "\n";

pdl_write();

if (is_file($text_log_file)) {
	unlink($text_log_file);
}
?>
--EXPECTF--
Watch php error:
$err[level] = 2
$err[label] = Watch
$err[msg] = Catch a php error (level = E_WARNING)
$err[data] = strpos() expects at least 2 parameters, 0 given
$err[file] = %s007.php

Watch load php file:
$load[level] = 1
$load[label] = Load
$load[msg] = Load a php file sample.php in %f msec(s)
$load[data] = File path: %ssample.php
$load[file] = %s007.php
